<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PVRTMemoryFileSystem.h</h1><a href="PVRTMemoryFileSystem_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         PVRTMemoryFileSystem.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        PVRTMemoryFileSystem</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     ANSI compatible</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Memory file system for resource files</span>
00014 <span class="comment"></span>
00015 <span class="comment">******************************************************************************/</span>
00016 <span class="preprocessor">#ifndef _PVRTMEMORYFILE_H_</span>
00017 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTMEMORYFILE_H_</span>
00018 <span class="preprocessor"></span>
00019 <span class="preprocessor">#include "<a class="code" href="PVRTGlobal_8h.html">PVRTGlobal.h</a>"</span>
00020 <span class="preprocessor">#include &lt;stddef.h&gt;</span>
00021 
<a name="l00022"></a><a class="code" href="classCPVRTMemoryFileSystem.html">00022</a> <span class="keyword">class </span><a class="code" href="classCPVRTMemoryFileSystem.html">CPVRTMemoryFileSystem</a>
00023 {
00024 <span class="keyword">public</span>:
00025     <a class="code" href="classCPVRTMemoryFileSystem.html#a0">CPVRTMemoryFileSystem</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pszFilename, <span class="keyword">const</span> <span class="keywordtype">void</span>* pBuffer, size_t Size, <span class="keywordtype">bool</span> bCopy = <span class="keyword">false</span>);
00026 
00027     <span class="comment">/*!***************************************************************************</span>
00028 <span class="comment">     @Function      RegisterMemoryFile</span>
00029 <span class="comment">     @Input         pszFilename     Name of file to register</span>
00030 <span class="comment">     @Input         pBuffer         Pointer to file data</span>
00031 <span class="comment">     @Input         Size            File size</span>
00032 <span class="comment">     @Input         bCopy           Name and data should be copied?</span>
00033 <span class="comment">     @Description   Registers a block of memory as a file that can be looked up</span>
00034 <span class="comment">                    by name.</span>
00035 <span class="comment">    *****************************************************************************/</span>
00036     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCPVRTMemoryFileSystem.html#e0">RegisterMemoryFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pszFilename, <span class="keyword">const</span> <span class="keywordtype">void</span>* pBuffer, size_t Size, <span class="keywordtype">bool</span> bCopy = <span class="keyword">false</span>);
00037 
00038     <span class="comment">/*!***************************************************************************</span>
00039 <span class="comment">     @Function      GetFile</span>
00040 <span class="comment">     @Input         pszFilename     Name of file to open</span>
00041 <span class="comment">     @Output        ppBuffer        Pointer to file data</span>
00042 <span class="comment">     @Output        pSize           File size</span>
00043 <span class="comment">     @Return        true if the file was found in memory, false otherwise</span>
00044 <span class="comment">     @Description   Looks up a file in the memory file system by name. Returns a</span>
00045 <span class="comment">                    pointer to the file data as well as its size on success.</span>
00046 <span class="comment">    *****************************************************************************/</span>
00047     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classCPVRTMemoryFileSystem.html#e1">GetFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pszFilename, <span class="keyword">const</span> <span class="keywordtype">void</span>** ppBuffer, size_t* pSize);
00048 
00049 
00050 
00051     <span class="comment">/*!***************************************************************************</span>
00052 <span class="comment">     @Function      GetNumFiles</span>
00053 <span class="comment">     @Return        The number of registered files</span>
00054 <span class="comment">     @Description   Getter for the number of registered files</span>
00055 <span class="comment">    *****************************************************************************/</span>
00056     <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classCPVRTMemoryFileSystem.html#e2">GetNumFiles</a>();
00057 
00058     <span class="comment">/*!***************************************************************************</span>
00059 <span class="comment">     @Function      GetFilename</span>
00060 <span class="comment">     @Input         i32Index        Index of file</span>
00061 <span class="comment">     @Return        A pointer to the filename of the requested file</span>
00062 <span class="comment">     @Description   Looks up a file in the memory file system by name. Returns a</span>
00063 <span class="comment">                    pointer to the file data as well as its size on success.</span>
00064 <span class="comment">    *****************************************************************************/</span>
00065     <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classCPVRTMemoryFileSystem.html#e3">GetFilename</a>(<span class="keywordtype">int</span> i32Index);
00066 
00067 <span class="keyword">protected</span>:
00068     <span class="keyword">class </span><a class="code" href="classCPVRTMemoryFileSystem_1_1CAtExit.html">CAtExit</a>
00069     {
00070     <span class="keyword">public</span>:
00071         <span class="comment">/*!***************************************************************************</span>
<a name="l00072"></a><a class="code" href="classCPVRTMemoryFileSystem_1_1CAtExit.html">00072</a> <span class="comment">        @Function       Destructor</span>
00073 <span class="comment">        @Description    Destructor of CAtExit class. Workaround for platforms that</span>
00074 <span class="comment">                        don't support the atexit() function. This deletes any memory</span>
00075 <span class="comment">                        file system data.</span>
00076 <span class="comment">        *****************************************************************************/</span>
00077         <a class="code" href="classCPVRTMemoryFileSystem_1_1CAtExit.html#a0">~CAtExit</a>();
00078     };
00079     <span class="keyword">static</span> <a class="code" href="classCPVRTMemoryFileSystem_1_1CAtExit.html">CAtExit</a> <a class="code" href="classCPVRTMemoryFileSystem.html#t0">s_AtExit</a>;
00080 
00081     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classCPVRTMemoryFileSystem_1_1CAtExit.html">CAtExit</a>;
00082 
00083     <span class="keyword">struct </span><a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html">SFileInfo</a>
<a name="l00084"></a><a class="code" href="classCPVRTMemoryFileSystem.html#t0">00084</a>     {
00085         <span class="keyword">const</span> <span class="keywordtype">char</span>* pszFilename;
<a name="l00086"></a><a class="code" href="classCPVRTMemoryFileSystem.html#n0">00086</a>         <span class="keyword">const</span> <span class="keywordtype">void</span>* pBuffer;
00087         size_t Size;
<a name="l00088"></a><a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html">00088</a>         <span class="keywordtype">bool</span> <a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html#o3">bAllocated</a>;
00089     };
<a name="l00090"></a><a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html#o0">00090</a>     <span class="keyword">static</span> <a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html">SFileInfo</a>* <a class="code" href="classCPVRTMemoryFileSystem.html#t1">s_pFileInfo</a>;
<a name="l00091"></a><a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html#o1">00091</a>     <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classCPVRTMemoryFileSystem.html#t2">s_i32NumFiles</a>;
<a name="l00092"></a><a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html#o2">00092</a>     <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classCPVRTMemoryFileSystem.html#t3">s_i32Capacity</a>;
<a name="l00093"></a><a class="code" href="structCPVRTMemoryFileSystem_1_1SFileInfo.html#o3">00093</a> };
00094 
<a name="l00095"></a><a class="code" href="classCPVRTMemoryFileSystem.html#t1">00095</a> <span class="preprocessor">#endif // _PVRTMEMORYFILE_H_</span>
<a name="l00096"></a><a class="code" href="classCPVRTMemoryFileSystem.html#t2">00096</a> <span class="preprocessor"></span>
<a name="l00097"></a><a class="code" href="classCPVRTMemoryFileSystem.html#t3">00097</a> <span class="comment">/*****************************************************************************</span>
00098 <span class="comment"> End of file (PVRTMemoryFileSystem.h)</span>
00099 <span class="comment">*****************************************************************************/</span>
00100 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
